import Vue from "vue";
import Router from "vue-router";
import ProductManagement from "../views/ProductManagement.vue";
import UserManagement from "../views/UserManagement.vue";
import OrderManagement from "../views/OrderManagement.vue";
import Sidebar from "@/views/Sidebar";
import demo from "@/views/demo";
import CommodityCheck from "@/views/CommodityCheck";
import FeedBackManagement from "@/views/FeedBackManagement";
import AgricultureManagement from "@/views/AgricultureManagement";
import Login from "@/views/Login";
import loading from "@/views/loading";
Vue.use(Router);

export default new Router({
  mode:"history",
  base: process.env.BASE_URL,
  routes: [
    {
      path: "/2",
      name: "Menu",
      component: Sidebar,
      children:[
        {
          path: "/product-management",
          name: "product-management",
          component: ProductManagement,
        },
        {
          path: "/user-management",
          name: "user-management",
          component: UserManagement,
        },
        {
          path: "/order-management",
          name: "order-management",
          component: OrderManagement,
        },
        {
          path: "/commodity-management",
          name: "commodity-management",
          component: CommodityCheck,
        },
        {
          path: "/feedback-management",
          name: "feedback-management",
          component: FeedBackManagement,
        },
        {
          path: "/agriculture-management",
          name: "agriculture-management",
          component: AgricultureManagement,
        }



      ]
    }
    ,{
      path: "/",
      name: "log",
      component: Login,

    },{
    path:"/loading2",
      name:"loading",
      component:loading
    }
  ],
});
